package com.cyclecoder.demo;

import com.cyclecoder.demo.event.RainEvent;
import com.cyclecoder.demo.event.SnowEvent;
import com.cyclecoder.demo.listener.RainEventListener;
import com.cyclecoder.demo.listener.SnowEventListener;
import com.cyclecoder.demo.listener.WeatherEventMulticaster;
import com.cyclecoder.demo.listener.WeatherRuningListener;

public class TestDemo {
    public static void main(String[] args) {
//        WeatherEventMulticaster weatherEventMulticaster = new WeatherEventMulticaster();
//        RainEventListener rainEventListener = new RainEventListener();
//        SnowEventListener snowEventListener = new SnowEventListener();
//        weatherEventMulticaster.addListener(rainEventListener);
//        weatherEventMulticaster.addListener(snowEventListener);
//
//        SnowEvent snowEvent = new SnowEvent();
//        RainEvent rainEvent = new RainEvent();
//        weatherEventMulticaster.multicastEvent(snowEvent);
        WeatherEventMulticaster weatherEventMulticaster = new WeatherEventMulticaster();
        RainEventListener rainEventListener = new RainEventListener();
        SnowEventListener snowEventListener = new SnowEventListener();
        weatherEventMulticaster.addListener(rainEventListener);
        weatherEventMulticaster.addListener(snowEventListener);
        WeatherRuningListener weatherRuningListener = new WeatherRuningListener(weatherEventMulticaster);
        weatherRuningListener.snow();
    }
}
